Skip to content

feat(phase-2): refine sql select options#217

Merged
overtrue merged 1 commit into
rustfs:mainfrom
GatewayJ:codex/refine-sql-select-options
Jun 6, 2026
Merged

feat(phase-2): refine sql select options#217
overtrue merged 1 commit into
rustfs:mainfrom
GatewayJ:codex/refine-sql-select-options

Conversation

@GatewayJ

Copy link
Copy Markdown
Member

Related issue(s)

None.

Background

The rc sql command gained broader S3 Select serialization options, but a few exposed paths did not match RustFS behavior closely enough. In particular, progress events were requested but not surfaced to users, and several RustFS-invalid argument combinations were only rejected by the backend.

Solution

  • Add structured Select options for CSV input/output, JSON input/output, ScanRange, and SSE-C without exposing unused progress events.
  • Validate CSV single-byte delimiter/quote/comment constraints before sending requests.
  • Validate ScanRange constraints for Parquet, JSON document input, negative offsets, and start-after-end ranges.
  • Map the validated options into the AWS SDK SelectObjectContent request and cover the new mapping/validation paths with tests.

Test status

  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace

@GatewayJ GatewayJ marked this pull request as ready for review June 6, 2026 05:45
@GatewayJ GatewayJ requested review from loverustfs and overtrue June 6, 2026 05:45

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: edcf1a7530

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +345 to +350
fn validate_scan_range_args(args: &SqlArgs) -> std::result::Result<(), String> {
if args.scan_start.is_none() && args.scan_end.is_none() {
return Ok(());
}
if matches!(args.input_format, InputFormatArg::Parquet) {
return Err("ScanRange is not supported for Parquet input".to_string());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject scan ranges for compressed CSV/JSON

When a user supplies --scan-start or --scan-end together with --compression gzip/bzip2 on CSV or JSON input, this validator lets the command proceed and the S3 layer attaches ScanRange to a compressed-object request. The AWS S3 Select user guide states that for scan range requests, “CSV and JSON objects must be uncompressed” (see https://docs.aws.amazon.com/AmazonS3/latest/userguide/selecting-content-from-objects.html#selecting-content-from-objects-scan-range), so these combinations fail at the backend instead of being reported as the intended usage error before sending the request.

Useful? React with 👍 / 👎.

@overtrue overtrue merged commit 1d3d746 into rustfs:main Jun 6, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants